import {request} from "@/utils";

export function getChannelApi(){
    return request({
        url:'/channels',
        method:'GET'
    })
}

export function createArticleApi(data){
    return request({
        url:'/mp/articles?draft=false',
        method:'POST',
        data
    })
}

export function updateArticleApi(data){
    return request({
        url:`/mp/articles/${data.id}?draft=false`,
        method:'PUT',
        data
    })
}

export function getArticleListApi(data){
    return request({
        url:'/mp/articles',
        method:'GET',
        params:data
    })
}

export function delArticleApi(id){
    return request({
        url:`/mp/articles/${id}`,
        method:'DELETE'
    })
}

export function getArticleByIdApi(id){ //默认方法为GET
    return request({
        url:`/mp/articles/${id}`
    })
}